package net.tv90.business.config;

import net.tv90.business.aspect.TokenVerifyInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Component
public class InterceptorConfig implements WebMvcConfigurer {

    @Autowired
    private TokenVerifyInterceptor tokenVerifyInterceptor;


    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        // 注册身份认证拦截器
        registry.addInterceptor(tokenVerifyInterceptor)
                .addPathPatterns("/**");
    }
}
